<template>
    <h1 style="color: #67c23a">个人中心</h1>
    <p>姓名：{{$route.params.username}}</p>
    <p>ID：{{$route.params.id}}</p>
    <router-view></router-view>
</template>

<script>
export default {
    name: "UserDemo",
    beforeRouteUpdate(to, from) {
        console.log(from, to.params)
    }
}
</script>

<style scoped>

</style>